package org.bigjava.novelplatform.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.ToString;
import org.bigjava.novelplatform.common.enums.PublishState;
import org.bigjava.novelplatform.common.enums.VerifyState;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.URL;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName chapter
 */
@TableName(value ="chapter")
@Data
@ToString
public class Chapter implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 书籍id
     */
    private Integer bookId;

    /**
     * 章节排序
     */
    private Integer chapterOrder;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 章节标题
     */
    @Length(max = 30)
    private String title;

    /**
     * 段落数
     */
    private Integer paragraphCount;

    /**
     * 字数
     */
    private Integer wordCount;

    /**
     * 存放路径
     */
    @URL
    private String chapterUrl;

    /**
     * 发布状态
     0未发布；1已发布；<br />发布后需要审核通过
     */
    private PublishState publish;

    /**
     * 审核状态
     0待审核；1审核通过；
     */
    private VerifyState verify;

    /**
     * 逻辑删除
     0未删除；1删除
     */
    private Integer deleteState;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}